﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Softeem.control
{
    public partial class MyButton : Button
    {
        public MyButton()
        {
            InitializeComponent();
            
        }
        public enum ButtonType
        {
            Primary,
            Default,
            Danger,
            Info,
            Warning,
            Success
        }

        public ButtonType BtnType { get; set; }

        public override Color BackColor
        {
            get
            {
                Color bgColor = Color.LightGray;
                switch (this.BtnType)
                {
                    case ButtonType.Primary:
                        bgColor = Color.FromArgb(65, 139, 202);
                        break;
                    case ButtonType.Danger:
                        bgColor = Color.FromArgb(239, 173, 77);
                        break;
                    case ButtonType.Default:
                        bgColor = Color.LightGray;
                        break;
                    case ButtonType.Info:
                        bgColor = Color.FromArgb(91, 192, 222);
                        break;
                    case ButtonType.Warning:
                        bgColor = Color.FromArgb(239, 173, 79);
                        break;
                    case ButtonType.Success:
                        bgColor = Color.FromArgb(91, 184, 93);
                        break;
                }
                
                return bgColor;
            }
        }
        
    }
}
